// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: ballview_limits.h,v 1.2 2008/08/06 05:58:13 xyzhang Exp $
//

#ifndef BALL_COMMON_LIMITS_H
#define BALL_COMMON_LIMITS_H

#include <limits>

namespace BALL 
{
	/**	Numeric limits class.
	This template class describes the minimum and maximum values for
	the differnet data types.
	It a substitute for the <tt>numeric_limits</tt> class described in the
	ISO/ANSI standard (chapter 18.2.1.1), as most compiler still do not support
	this feature (or more precisely: the header file \<limits\> is not implemented).
	If \<limits\> exists, Limits is just a wrapper around the <tt>numeric_limits</tt> class,
	otherwise it returns the value from the standard C header \<limits.h\>. \par

	\ingroup Common
	*/
	template <typename T>
	class Limits
	{
	public:

		/**	Return the minimum value.
		@return T the minimum value for this datatype
		*/
		static T min()  
		{ 
			return std::numeric_limits<T>::min(); 
		}

		/**	Return the maximum value.
		@return T the maximum value for this datatype
		*/
		static T max()  
		{ 
			return std::numeric_limits<T>::max(); 
		}
	};

}	// namespace BALL

#endif // BALL_COMMON_LIMITS_H
